IF NOT EXISTS (SELECT 1 FROM sys.objects
					 WHERE type ='u' AND object_id = OBJECT_ID('MD3.FKConstraints'))
BEGIN
	
	CREATE TABLE MD3.FKConstraints
	   (Id              BIGINT IDENTITY(1,1) NOT NULL,
			ForeignKeyName		SYSNAME NOT NULL,   
			SchemaName			SYSNAME NOT NULL, 
			TableName			SYSNAME NOT NULL,
			KeyColumns			VARCHAR(MAX)NOT NULL,
			ParentSchemaName	SYSNAME NOT NULL, 
			ParentTableName		SYSNAME NOT NULL,
			ParentKeyColumns	VARCHAR(MAX)NOT NULL,
			IsNotTrusted        BIT NOT NULL,
			IsDeleteCascade     BIT NOT NULL,
			IsUpdateCascade     BIT NOT NULL, 
			DropFK				BIT NOT NULL

	);
	   
	ALTER TABLE MD3.FKConstraints ADD CONSTRAINT FKConstraintsPK 
	PRIMARY KEY CLUSTERED (Id);
		
END 
--drop table MD3.FKConstraints
